const express = require("express");
const router = express.Router();

const { validateRigister, validateLogin } = require("../validator/user");
const { authenticateToken, authorize } = require("../middleware/auth");
const ResponseHelper = require("../util/response");

const userController = require("../controller/user");
// 用户登录
router.post("/login", validateLogin, userController.login);

// 用户注册
router.post("/register", validateRigister, userController.register);

// 获取当前登录用户信息
router.get("/current", authenticateToken, userController.getCurrent);

module.exports = router;
